import base64
import numpy as np
import cv2
import os
from django.http import HttpResponse
# from django.utils.baseconv import base64

def testpic(request):
    if (request.method == 'POST'):
        img = cv2.imread('C:/Users/hsj/PycharmProjects/cv_platform/datasource/views/11.png')
        aa = base64.b64encode(cv2.imencode('.jpg', img)[1]).decode()
        return HttpResponse(aa)

